Check whether two lists are circularly identicalΒΆ
Write a python program to check whether two lists are circularly identical.
L1 = [10, 10, 0, 0, 10]
L2 = [10, 10, 10, 0, 0]
L3 = [1, 10, 10, 0, 0]
print('Compare list1 and list2: ', end="")
print(' '.join(map(str, L2)) in ' '.join(map(str, L1 * 2)))
print('Compare list1 and list3', end="")
print(' '.join(map(str, L3)) in ' '.join(map(str, L1 * 2)))
Output:
Compare list1 and list2: True
Compare list1 and list3: False